import request from '@/utils/request'

/**
 * 获取标签列表
 * @param {*} data
 * @returns
 */
export const getTagListApi = data => {
  return request({
    method: 'get',
    url: '/ydd_tag/list',
    params: data
  })
}

/**
 * 删除
 */

export const delTagApi = id => {
  return request({
    method: 'get',
    url: `/ydd_tag/del?id=${id}`
  })
}

/**
 * 新增
 */

export const addTagApi = data => {
  return request({
    method: 'post',
    url: '/ydd_tag/add',
    data
  })
}

/**
 * 标签详情
 */
export const getTagInfoApi = id => {
  return request({
    method: 'get',
    url: `/ydd_tag/rowInfo?id=${id}`
  })
}

/**
 * 修改
 */
export const editTagInfoApi = data => {
  return request({
    method: 'post',
    url: '/ydd_tag/update',
    data
  })
}

/**
 * 获取全部文章标签
 */
export const getTagAllApi = () => {
  return request({
    method: 'get',
    url: '/ydd_tag/all'
  })
}
